<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript">
			window.onload = function(){
//				var input = document.getElementsByTagName("input");
				var word = ["奔驰","宝马","奥迪"];
				var ul = document.createElement("ul");
				for(var i in word){
					console.log(i);
					var li = document.createElement("li");
					var txt = document.createTextNode(word[i]);
					li.appendChild(txt);
					ul.appendChild(li);
					li.addEventListener('mouseover',function(){
						this.style.backgroundColor = "rgb(128,128,128)";
					});
					li.addEventListener('mouseout',function(){
						this.style.backgroundColor = "white";
					});
				}
				document.body.appendChild(ul);
			}
//			function onmouseover(){
//				li.innerHTML = "<span style='background-color: rgb(51,51,51);'></span>"
//			}
//			function onmouseout(){
//				li.innerHTML = "<span style='background-color: rgb(51,51,51);'></span>"
//			}
//			input.onmouseover = function(){
//						li.innerHTML = "<span style='background-color: rgb(51,51,51);'></span>"
//			}
//			input.onmouseout = function(){
//						li.innerHTML = "<span style='background-color: rgb(51,51,51);'></span>"
//			}
		</script>
	</head>
	<body>
	</body>
</html>
